<template>
   <div>
        <b-form-group label="请投票：">
            <b-form-radio-group v-model="selected"
                                :options="options"
                                stacked>
            </b-form-radio-group>
        </b-form-group>
        <div class="mt-3">
            投给：<strong>{{ selected }}</strong>
        </div>
        <br>
        <button type="button" class="btn btn-success btn-sm"
        @click="onClick">提交</button>
        <b-modal ref="alert-modal" id="modal1" title="已投票">
            <p class="my-4">请您不要重复投票，谢谢！</p>
        </b-modal>
   </div> 
</template>

<script>
export default {
   props: ["options", "getData"],
   data() {
       return {
           selected: ''
       }
   },
   methods: {
       onClick() {
           this.$emit('submit', this.selected)
       }
   },
   created() {
       this.getData()
   }
}
</script>

